/**
 * @param {string} s
 * @return {number}
 */
var countKeyChanges = function(s) {
    const str = s.toUpperCase()
    const arr = str.split('')
    let result = 0
    for (i = 1; i<s.length;i++) {
        arr[i] === str[i-1] ? undefined: result++;
    }
    return result
};

console.log(countKeyChanges("aAbBcC"))